<?php
//we need to set a var to find what page we are on
global $pageOn;
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>
	<?php
	if (isset($this->data['title']))
	{
		print $this->data['title'];
	}
	?>
	</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
	<div id="header">
		<div id="logo">
			<div id="logo_text">
			  <h1><a href="#">Photo<span class="logo_colour"> album</span></a></h1>
			</div>
		</div>
		<div id="menubar">
			<ul id="menu">
				<?php
				if (isset($_SESSION['user']))
				{ 
					//print 'Hello ' . $_SESSION['user']->getUserName();
				?>
				<li <?php if($pageOn == 'category.php'){?> class="selected"<?php }?>><a href="category.php?root=true">Home</a></li>
				<li <?php if($pageOn == 'profile.php'){?> class="selected"<?php }?>><a href="profile.php">Profile</a></li>
				<li class="prelogout"></li>
				<li><a href="logout.php">
				<?php
					print 'Hello ' . $_SESSION['user']->getUserName() . ', Logout';
				?>
				</a></li>
				<?php
				}
				else 
				{ 
				?>
				<li <?php if($pageOn == 'login.php'){?> class="selected"<?php }?>><a href="login.php">Login</a></li>
				<li <?php if($pageOn == 'register.php'){?> class="selected"<?php }?>><a href="register.php">Register</a></li>
				<?php
				} 
				?>
			</ul>
		</div>
	</div>
	<div id="content_header">
	</div>
	
	<div id="site_content">	
	    <?php
    if (isset($this->data['error']))
    {
		print '<div class="fieldset">Error: ';
    	print $this->data['error'];
		print '</div>';
    }
    else if (isset($this->data['notification']))
    {
		print '<div class="fieldset">';
    	print $this->data['notification'];
		print '</div>';
    }
    ?>
    <?php 
    include $content 
    ?>
	</div>
	
	<div class="cleaner"></div>
	<div id="content_footer">
	</div>
	<div id="footer">
      All Copyrights &copy; reserved
    </div>
</body>
</html>